package com.example.robertluozizhao.framecollectdemo.activity.test.cortoutine

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.util.Log
import com.example.robertluozizhao.java.test.kotlin.suspend.TestSuspend
import kotlinx.coroutines.*
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.coroutineContext

/**
 * <pre>
 *     author: luozz@anjiu-tech.com
 *     time  : 2020/12/4
 *     desc  :
 * </pre>
 */
class CoroutineTestActivity :AppCompatActivity(){


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        GlobalScope.launch(Dispatchers.Main){

            Log.d("CoroutineTestActivity", "onCreate:  1.....")
            val member = TestSuspend.INSTANCE.getMember()
            Log.d("CoroutineTestActivity", "main: 4.......")
            withContext(Dispatchers.Main) {
                println(member.toString())
            }
        }

//        val coroutineScope = CoroutineScope(CoroutineContext())

    }
}